const user = require('./user')
const name = require('./name')

// 云函数入口文件
const cloud = require('wx-server-sdk')
const axios = require('axios');

cloud.init({
    // API 调用都保持和云函数当前所在环境一致
    env: cloud.DYNAMIC_CURRENT_ENV
  })

// 云函数入口函数
exports.main = async (event, context) => {
    const wxContext = cloud.getWXContext()

    let res = await axios({
        url: 'https://xueerqin.net',
        method: 'get',
     
      })
      console.log('==============')
    console.log(res.data)

    return {
        event,
        openid: wxContext.OPENID,
        appid: wxContext.APPID,
        unionid: wxContext.UNIONID,
       a: res.data
    }
}